﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class DistributerAC : System.Web.UI.Page
{
    WebDBDataContext db = new WebDBDataContext();



    protected void Page_Load(object sender, EventArgs e)
    {


        #region get uid
        D.Text = Session["user"].ToString();
        string uname = D.Text;

        Tbl_User tb_user = new Tbl_User();// 
        tb_user = db.Tbl_Users.Single(un => un.Use_Name == uname);


        string uid = tb_user.Use_ID;//user id=DisiD


        #endregion

        Tbl_Distributor tb_Dis = new Tbl_Distributor();


        tb_Dis = db.Tbl_Distributors.Single(cacc => cacc.Dis_ID == uid);
        name.Text = tb_Dis.Giv_Name;
        //img
        string impath = "female-icon.jpg";
        Image1.ImageUrl = "img/profile/"+impath;
        address.Text = tb_Dis.Address1;
        city.Text = tb_Dis.City;
        country.Text = tb_Dis.Country;
        tele.Text = tb_Dis.Hom_Tel_No;
        mobi.Text = tb_Dis.Mob_No;
        mail.Text = tb_Dis.Email;
        birth.Text = tb_Dis.Dob;




        Bonus bonx = new Bonus();

        bonx = db.Bonus.Single(ui => ui.User_id == uid);

        ppv.Text = bonx.ppv.ToString();
        cpv.Text = bonx.Cpv.ToString();
        bv.Text = bonx.Bv.ToString();
        tsales.Text = bonx.ToString();
        us.Text = bonx.T_sales.ToString();










































    }
}